package com.zmsoft.persistent.sfg.Sfg662041GameCropsGrow;

import javax.annotation.Resource;

import org.cnsoft.framework.beans.common.RESTResultBean;
import org.cnsoft.framework.constants.ECCodeMessageConstants;
import org.cnsoft.framework.db.page.PageModel;
import org.cnsoft.framework.support.MyBusinessSupport;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * 物品阶段配置信息-自动触发业务处理
 */
@Component("Sfg662041GameCropsGrowBusinesslogic")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Sfg662041GameCropsGrowBusinesslogic extends MyBusinessSupport {
	@Resource
	private Sfg662041GameCropsGrowDao daoSfg662041GameCropsGrow;

	// 一览（分页查询）
	public RESTResultBean<Sfg662041GameCropsGrowDBO> doList(PageModel<Sfg662041GameCropsGrowDBO> pageModel) {
		// 定义返回结果集合
		RESTResultBean<Sfg662041GameCropsGrowDBO> result = new RESTResultBean<Sfg662041GameCropsGrowDBO>();
		// 分页查询
		result.setData(daoSfg662041GameCropsGrow.doSelectPage(pageModel));
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_SELECT);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息详情
	public RESTResultBean<Sfg662041GameCropsGrowDBO> doInfo(Sfg662041GameCropsGrowDBO param) {
		// 定义返回结果集合
		RESTResultBean<Sfg662041GameCropsGrowDBO> result = new RESTResultBean<Sfg662041GameCropsGrowDBO>();
		// 查询详情
		result.setData(daoSfg662041GameCropsGrow.doRead(param));
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_SELECT);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息插入
	public RESTResultBean<String> doAppend(Sfg662041GameCropsGrowDBO param) {
		// 定义返回结果集合
		RESTResultBean<String> result = new RESTResultBean<String>();
		// 信息插入
		daoSfg662041GameCropsGrow.doInsertSelective(param);
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_INSERT);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息编辑
	public RESTResultBean<String> doModify(Sfg662041GameCropsGrowDBO param) {
		// 定义返回结果
		RESTResultBean<String> result = new RESTResultBean<String>();
		// 信息插入
		daoSfg662041GameCropsGrow.doUpdate(param);
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_UPDATE);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

	// 信息删除
	public RESTResultBean<String> doDiscard(Sfg662041GameCropsGrowDBO param) {
		// 定义返回结果
		RESTResultBean<String> result = new RESTResultBean<String>();
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		daoSfg662041GameCropsGrow.doDelete(param);
		// 设定提示信息
		result.setResult(ECCodeMessageConstants.MESSAGE_DB_DELETE);
		// 输出结果日志
		logger.debug("result=====>>>>" + result.toString());
		return result;
	}

}
